<%
# View which displays a form for creating a user.
#
# Author::      Eli Fox-Epstein, efoxepstein@wesleyan.edu
# Author::      Dimitar Gochev, dimitar.gochev@trincoll.edu
# Copyright::   Humanitarian FOSS Project (http://www.hfoss.org), Copyright (C) 2009.
# License::     http://www.gnu.org/copyleft/lesser.html GNU Lesser General Public License (LGPL)
%>

<% content_for :title, title ('Create an account', @instance.short_name)%>

<% content_for :body do %>
<%= flashes %>
<div id="wrap">
	<h1>Sign up as a new user</h1>
	<% @user.password = @user.password_confirmation = nil %>
	
	<%= error_messages_for :user %>
	<% form_for [@instance, @user] do |f| -%>
		<p><%= f.label 'first_name' %><br/>
		<%= f.text_field :first_name %></p>
		
		<p><%= f.label 'last_name' %><br/>
		<%= f.text_field :last_name %></p>
	
		<p><%= f.label 'email' %><br/>
		<%= f.text_field :email %></p>
		
		<p><%= f.label 'desk_phone' %><br/>
		<%= f.text_field :desk_phone %> <%= f.label 'desk_phone_ext', 'ext' %> <%= f.text_field :desk_phone_ext, :size => 4 %></p>
		
		<p><%= f.label 'cell_phone' %><br/>
		<%= f.text_field :cell_phone %></p>
		
		<p>Preferred:</p>
		<%= f.radio_button(:preferred_is_cell, true) + f.label('preferred_is_cell_true', "Cell Phone") %>
		<%= f.radio_button(:preferred_is_cell, false) + f.label('preferred_is_cell_false', "Desk phone") %>
		
		<p><%= f.label 'carrier' %>
		<%= f.select :carrier_id, Carrier.all.map {|c| [c.name, c.id]}, :include_blank => 'Not Listed' %></p>
	
		<p><%= f.label 'password' %><br/>
		<%= f.password_field :password %></p>
	
		<p><%= f.label 'password_confirmation', 'Confirm Password' %><br/>
		<%= f.password_field :password_confirmation %></p>
	
		<p><%= submit_tag 'Sign up' %></p>
	<% end %>
</div>
<% end %>
